package e.odbo.data.dao.table;

import com.openbravo.data.loader.serialize.serializer.SerializerRead;
import com.openbravo.data.loader.serialize.serializer.SerializerWrite;
import e.odbo.data.dsl.query.QBFParameter;
import e.odbo.data.dsl.query.QBFParameters;
import com.openbravo.data.loader.sentence.SentenceExec;
import com.openbravo.data.loader.sentence.SentenceFind;
import com.openbravo.data.loader.sentence.SentenceList;
import e.odbo.data.dao.I_ParentNode;
import e.odbo.data.dsl.operation.QueryOperation;
import e.odbo.data.sample.security.I_SecurityFilter;
import e.odbo.data.dsl.Select;

import java.util.Date;

public  interface I_TableSentenceBuilder {

      //list
      SentenceList getListSentence(TableDefinition tableDefinition);

      SentenceList getListSentence(TableDefinition tableDefinition,SerializerRead sr);

      SentenceList getListSentence(TableDefinition tableDefinition,SerializerRead sr,int[] fieldIndexs);

      SentenceList getListWithTimeSentence(TableDefinition tableDefinition,SerializerRead sr, Date start, Date end);

      SentenceList getListByParentSentence(TableDefinition tableDefinition,I_ParentNode parent,Class realParentClass,SerializerRead sr);

      SentenceList getLisBySelectSentence(Select select, SerializerRead sr);

      //list QueryOperation

      SentenceList getListSentence(TableDefinition tableDefinition,QueryOperation queryOperation);

      SentenceList getListSentence(TableDefinition tableDefinition,SerializerRead sr,QueryOperation queryOperation);

      SentenceList getListSentence(TableDefinition tableDefinition,SerializerRead sr,int[] fieldIndexs,QueryOperation queryOperation);

      SentenceList getListWithTimeSentence(TableDefinition tableDefinition,SerializerRead sr, Date start, Date end,QueryOperation queryOperation);

      SentenceList getListByParentSentence(TableDefinition tableDefinition,I_ParentNode parent,Class realParentClass,SerializerRead sr,QueryOperation queryOperation);


      //find
      SentenceFind getFindSentence(TableDefinition tableDefinition);

      SentenceFind getFindSentence(TableDefinition tableDefinition,SerializerRead sr);

      SentenceFind getFindSentence(TableDefinition tableDefinition,SerializerRead sr, SerializerWrite sw);

      SentenceFind getFindSentence(TableDefinition tableDefinition,SerializerRead sr, SerializerWrite sw,int[] fieldIndexs);

      SentenceFind getFindByFieldIndexSentence(TableDefinition tableDefinition,int index);

      //delete
      SentenceExec getDeleteSentence(TableDefinition tableDefinition);

      SentenceExec getDeleteSentence(TableDefinition tableDefinition,SerializerWrite sw);

      SentenceExec getClearSentence(TableDefinition tableDefinition);


      //instert
      SentenceExec getInsertSentence(TableDefinition tableDefinition);

      SentenceExec getInsertSentence(TableDefinition tableDefinition,int[] fieldindx);

      SentenceExec getInsertSentence(TableDefinition tableDefinition,SerializerWrite objWrite);


      //count
      SentenceExec getCountSentence(TableDefinition tableDefinition);

      SentenceFind getCountSentence(TableDefinition tableDefinition,QBFParameters filter);

      //exist
      SentenceFind getExistSentence(TableDefinition tableDefinition,SerializerWrite rowWriter);

      SentenceFind getExistSentence(TableDefinition tableDefinition,String[] fields);


      //update
      SentenceExec getUpdateSentence(TableDefinition tableDefinition);

      SentenceExec getUpdateSentence(TableDefinition tableDefinition,int[] fieldindx);

      SentenceExec getUpdateSentence(TableDefinition tableDefinition,SerializerWrite rowWriter);

      SentenceExec getUpdateSentence(TableDefinition tableDefinition,int[] fieldindx, SerializerWrite rowWriter);

     //query
      SentenceList getQuerySentence(TableDefinition tableDefinition,QBFParameters filter,SerializerRead sr);

      SentenceExec getDeleteSentence(TableDefinition tableDefinition,QBFParameters filter);

      SentenceFind getCountSentence(TableDefinition tableDefinition,QBFParameter filter);

      //query QueryOperation
      SentenceList getQuerySentence(TableDefinition tableDefinition,QBFParameters filter,SerializerRead sr,QueryOperation queryOperation);

      SentenceList getQuerySentence(TableDefinition tableDefinition,int[] fieldIndexs,QBFParameters filter,SerializerRead sr,QueryOperation queryOperation);

      SentenceList getQuerySentence(TableDefinition tableDefinition,int[] fieldIndexs,QBFParameters filter,SerializerRead sr);

      I_SecurityFilter getSecurityFilter();

}
